<link href="//cdn.bootcss.com/plupload/2.1.9/jquery.ui.plupload/css/jquery.ui.plupload.css" rel="stylesheet">
<script src="//cdn.bootcss.com/jquery/1.12.2/jquery.js"></script>
<script src="//cdn.bootcss.com/plupload/2.1.9/plupload.full.min.js"></script>
<script src="//cdn.bootcss.com/plupload/2.1.9/jquery.plupload.queue/jquery.plupload.queue.min.js"></script>
<script src="//cdn.bootcss.com/plupload/2.1.9/i18n/zh_CN.js"></script>
<script src="http://admin.io/app/moxie.js"></script>
<script src="http://admin.io/app/qiniu.js"></script>
<div id="container">
    <button id="pickfiles" class="btn btn-primary btn-lg btn-block" type="submit">上传图片</button>
</div>
<img id="img" src="">
<script>
    var refresh=function(img){
        $("#img").attr("src",img);
    };
    var uploader = Qiniu.uploader({
        runtimes: 'html5,flash,html4', //上传模式,依次退化
        browse_button: 'pickfiles', //上传选择的点选按钮，**必需**
        uptoken_url: 'auth地址', //Ajax请求upToken的Url，**强烈建议设置**（服务端提供）
        domain: 'http://ofc9whdve.bkt.clouddn.com/', //bucket 域名，下载资源时用到，**必需**
        container: 'container', //上传区域DOM ID，默认是browser_button的父元素，
        max_file_size: '100mb', //最大文件体积限制
        flash_swf_url: '//cdn.bootcss.com/plupload/2.1.9/Moxie.swf', //引入flash,相对路径
        max_retries: 3, //上传失败最大重试次数
        dragdrop: true, //开启可拖曳上传
        drop_element: 'container', //拖曳上传区域元素的ID，拖曳文件或文件夹后可触发上传
        chunk_size: '4mb', //分块上传时，每片的体积
        auto_start: true, //选择文件后自动上传，若关闭需要自己绑定事件触发上传
        init: {
            'UploadProgress': function(up, file) {
                $('#pickfiles').prop('disabled', true).html('图片上传中...');
            },
            'FileUploaded': function(up, file, info) {

                $('#pickfiles').prop('disabled', false).html('上传图片');
                var res = JSON.parse(info);
                imgUrl = up.getOption('domain') + res.key;
                //############################################################################
                //############                     imgUrl                         ############
                //############################################################################
                //############################################################################
                refresh(imgUrl);
            },
            'Error': function(up, err, errTip) {
                $('#pickfiles').prop('disabled', false).html('上传图片');
            }
        }
    });
</script>